package gui;

import java.awt.Color;
import java.awt.GridLayout;
import java.awt.event.MouseEvent;
import javax.swing.JButton;

public class GUIWindowMenuMultiplayer extends GUIWindowMenuMain
{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private JButton createGame = new JButton("Create a game");
	private JButton joinGame = new JButton("Join a game");
	protected JButton home = new JButton("Home");
		
	public GUIWindowMenuMultiplayer()
	{
		super();
		this.menu.removeAll();
		
		buttonProperties(createGame);
		buttonProperties(joinGame);
		buttonProperties(home);

		menu.setLayout(new GridLayout(3,1,20,20));
		menu.add(createGame);
		menu.add(joinGame);
		menu.add(home);
	}
	

	public void mouseClicked(MouseEvent e)
	{
		if(e.getSource() == this.createGame)
		{
		}
		else if(e.getSource() == this.joinGame)
		{
		}
		else if(e.getSource() == this.home) 
		{
			this.dispose();
			GUIWindowMenuMain mainMenu = new GUIWindowMenuMain();
			mainMenu.setVisible(true); 
		}
	}

	public void mouseEntered(MouseEvent e)
	{
		if(e.getSource()==this.createGame)
		buttonOnMouseEntered(createGame);
		if(e.getSource()==this.joinGame)
		buttonOnMouseEntered(joinGame);
		if(e.getSource()==this.home)
		buttonOnMouseEntered(home);
	}

	public void mouseExited(MouseEvent e)
	{
		if(e.getSource()==this.createGame)
		this.createGame.setBackground(Color.white);
		if(e.getSource()==this.joinGame)
		this.joinGame.setBackground(Color.white);
		if(e.getSource()==this.home)
		this.home.setBackground(Color.white);
	}
	
	public void mousePressed(MouseEvent e){}
	public void mouseReleased(MouseEvent e){}

}